﻿using System;
using Microsoft.Xna.Framework;


namespace LoD.WPClientLibrary.Animations {
    public class OrbitalMovement : Animation {
        public OrbitalMovement(Vector2 center, int radius, double angle, float velocity) {
            Animating = true;
            this.Center = center;
            this.Radius = radius;
            this.Angle = angle;
            this.Velocity = velocity;
        }

        public double Angle { get; set; }
        public Vector2 Center { get; set; }
        public int Radius { get; set; }
        public float Velocity { get; set; }

        public override Vector2 ModifyPosition(Vector2 original) {
            Vector2 modified = original;
            this.Angle += this.Velocity;
            modified.X = this.Center.X + (float)(Math.Cos(this.Angle) * this.Radius);
            modified.Y = this.Center.Y + (float)(Math.Sin(this.Angle) * this.Radius);
            return modified;
        }
    }
}